package com.quarkus.validate;

import lombok.extern.slf4j.Slf4j;

import javax.enterprise.context.ApplicationScoped;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.NotBlank;

/**
 * @Author: TongRui乀
 * @Date: 2021/2/28 10:52
 * @description：
 */
@ApplicationScoped
@Slf4j
public class MyNotBlankValidator implements ConstraintValidator<NotBlank, String> {

    @Override
    public boolean isValid(String s, ConstraintValidatorContext context) {
        log.info("自定义参数校验");
        return s == null || "".equals(s);
    }

}
